Builder

class Builder(name: Text, action: Function<Position, Boolean>)

A builder of ContextAction. This is used in ContextHandler and ContextProvider to incrementally build actions, with modifications applied on different layers of context handling/provision as needed.

See the Wiki for a detailed overview of the ContextAction system in fzzy config.

Author

fzzyhmstrs

Since

0.6.0

Parameters

name

Text

Constructors

Link copied to clipboard
constructor(name: Text, action: Function<Position, Boolean>)

Functions

Link copied to clipboard

Replaces this builders active state supplier with a new one.

Link copied to clipboard

Builds the ContextAction for deployment in a context handler setting. This is handled internally for Config GUI entries, but can be used for actions added to other contexts.

Link copied to clipboard

Applies an icon to this action for display in a context menu. Default icon is no icon at all, simply a blank space to line the text up with actions that do have an icon.

Link copied to clipboard

Whether this builder is for context menu use or not.

Link copied to clipboard
fun narration(narration: Text): ContextAction.Builder

Adds context menu narration to this action. Default narration will only announce the action name. This narration should be used to provide detailed information about the circumstances and consequences of using the action.

Link copied to clipboard

Marks that this action should not appear in a context menu (keybind-only activation)

Link copied to clipboard

Applies modifications to the current active supplier of this builder. This can be used to "AND" or "OR" a previous supplier, for example.